package cn.lili.controller.feign.order;

import cn.lili.modules.order.order.client.OrderStatisticsClient;
import cn.lili.modules.order.order.entity.dto.OrderStatisticsSearchParams;
import cn.lili.modules.order.order.entity.vo.OrderSimpleVO;
import cn.lili.modules.order.order.service.OrderStatisticsService;
import cn.lili.modules.statistics.entity.dto.OrderPromotionStatisticsQueryParam;
import cn.lili.modules.statistics.entity.dto.StatisticsQueryParam;
import cn.lili.modules.statistics.entity.vo.OrderStatisticsDataVO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author paulG
 * @since 2022/6/28
 **/
@RestController
@RequiredArgsConstructor
public class OrderStatisticsFeignController implements OrderStatisticsClient {

    private final OrderStatisticsService orderStatisticsService;

    @Override
    public long orderNum(String orderStatus, String storeId) {
        return orderStatisticsService.orderNum(orderStatus, storeId);
    }

    @Override
    public List<OrderStatisticsDataVO> statisticsChart(StatisticsQueryParam statisticsQueryParam) {
        return orderStatisticsService.statisticsChart(statisticsQueryParam);
    }

    @Override
    public Page<OrderSimpleVO> getStatistics(StatisticsQueryParam statisticsQueryParam) {
        return orderStatisticsService.getStatistics(statisticsQueryParam, statisticsQueryParam);
    }

    @Override
    public Map<String, Object> getMap(OrderStatisticsSearchParams searchParams) {
        return orderStatisticsService.getMap(searchParams.getQueryWrapper());
    }

    @Override
    public Page<OrderSimpleVO> getOrderPromotionStatistics(OrderPromotionStatisticsQueryParam statisticsQueryParam) {
        return orderStatisticsService.getOrderPromotionStatistics(statisticsQueryParam);
    }

    @Override
    public long orderNumByUrban(String orderStatus) {
        return orderStatisticsService.orderNumByUrban(orderStatus);
    }


}
